<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TMCStepper: src/source/TMC2660Stepper.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">TMCStepper
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_t_m_c2660_stepper_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TMC2660Stepper.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_t_m_c2660_stepper_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_t_m_c_stepper_8h.html">TMCStepper.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_s_w___s_p_i_8h.html">SW_SPI.h</a>&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#ad4519bfdf8acc6afdceed090708ea826">    4</a></span>&#160;<a class="code" href="class_t_m_c2660_stepper.html#ad4519bfdf8acc6afdceed090708ea826">TMC2660Stepper::TMC2660Stepper</a>(uint16_t pinCS, <span class="keywordtype">float</span> RS) :</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;  _pinCS(pinCS),</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;  Rsense(RS)</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;  {}</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a57db3bed855e51e90b4aad1e2648282c">    9</a></span>&#160;<a class="code" href="class_t_m_c2660_stepper.html#ad4519bfdf8acc6afdceed090708ea826">TMC2660Stepper::TMC2660Stepper</a>(uint16_t pinCS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK) :</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;  _pinCS(pinCS),</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;  Rsense(default_RS)</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;  {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <a class="code" href="class_s_w___s_p_i_class.html">SW_SPIClass</a> *SW_SPI_Obj = <span class="keyword">new</span> <a class="code" href="class_s_w___s_p_i_class.html">SW_SPIClass</a>(pinMOSI, pinMISO, pinSCK);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    TMC_SW_SPI = SW_SPI_Obj;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;  }</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a544ba0e5d5b3a2381cfea01b3a752fd1">   17</a></span>&#160;<a class="code" href="class_t_m_c2660_stepper.html#ad4519bfdf8acc6afdceed090708ea826">TMC2660Stepper::TMC2660Stepper</a>(uint16_t pinCS, <span class="keywordtype">float</span> RS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK) :</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  _pinCS(pinCS),</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  Rsense(RS)</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <a class="code" href="class_s_w___s_p_i_class.html">SW_SPIClass</a> *SW_SPI_Obj = <span class="keyword">new</span> <a class="code" href="class_s_w___s_p_i_class.html">SW_SPIClass</a>(pinMOSI, pinMISO, pinSCK);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    TMC_SW_SPI = SW_SPI_Obj;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  }</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">   25</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">TMC2660Stepper::switchCSpin</a>(<span class="keywordtype">bool</span> state) {</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;  <span class="comment">// Allows for overriding in child class to make use of fast io</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  digitalWrite(_pinCS, state);</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;}</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#aba43e2af829abee9e029bdd43bde5f61">   30</a></span>&#160;uint32_t <a class="code" href="class_t_m_c2660_stepper.html#aba43e2af829abee9e029bdd43bde5f61">TMC2660Stepper::read</a>() {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  uint32_t response = 0UL;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  uint32_t dummy = ((uint32_t)DRVCONF_register.address&lt;&lt;17) | DRVCONF_register.sr;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;  <span class="keywordflow">if</span> (TMC_SW_SPI != <span class="keyword">nullptr</span>) {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(LOW);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    response |= TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>((dummy &gt;&gt; 16) &amp; 0xFF);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    response &lt;&lt;= 8;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    response |= TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>((dummy &gt;&gt;  8) &amp; 0xFF);</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    response &lt;&lt;= 8;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    response |= TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>(dummy &amp; 0xFF);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    SPI.beginTransaction(SPISettings(spi_speed, MSBFIRST, SPI_MODE3));</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(LOW);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    response |= SPI.transfer((dummy &gt;&gt; 16) &amp; 0xFF);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    response &lt;&lt;= 8;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    response |= SPI.transfer((dummy &gt;&gt;  8) &amp; 0xFF);</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    response &lt;&lt;= 8;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    response |= SPI.transfer(dummy &amp; 0xFF);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    SPI.endTransaction();</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  }</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(HIGH);</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keywordflow">return</span> response &gt;&gt; 4;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a4ab9b5cf6da0c345ecc50e877b54ada2">   54</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a4ab9b5cf6da0c345ecc50e877b54ada2">TMC2660Stepper::write</a>(uint8_t addressByte, uint32_t config) {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  uint32_t data = (uint32_t)addressByte&lt;&lt;17 | config;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  <span class="keywordflow">if</span> (TMC_SW_SPI != <span class="keyword">nullptr</span>) {</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(LOW);</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>((data &gt;&gt; 16) &amp; 0xFF);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>((data &gt;&gt;  8) &amp; 0xFF);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    TMC_SW_SPI-&gt;<a class="code" href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">transfer</a>(data &amp; 0xFF);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    SPI.beginTransaction(SPISettings(spi_speed, MSBFIRST, SPI_MODE3));</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(LOW);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    SPI.transfer((data &gt;&gt; 16) &amp; 0xFF);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    SPI.transfer((data &gt;&gt;  8) &amp; 0xFF);</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    SPI.transfer(data &amp; 0xFF);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    SPI.endTransaction();</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  }</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(HIGH);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;}</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a36fec657eca5845bef6668fd2fce1b54">   72</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a36fec657eca5845bef6668fd2fce1b54">TMC2660Stepper::begin</a>() {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  <span class="comment">//set pins</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  pinMode(_pinCS, OUTPUT);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">switchCSpin</a>(HIGH);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="comment">//TODO: Push shadow registers</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#abe01a905588d5feb41ec3a967512027f">toff</a>(8); <span class="comment">//off_time(8);</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>(1); <span class="comment">//blank_time(24);</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;}</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#aec662c467455f109ba504f69495ac90f">   83</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_t_m_c2660_stepper.html#aec662c467455f109ba504f69495ac90f">TMC2660Stepper::isEnabled</a>() { <span class="keywordflow">return</span> <a class="code" href="class_t_m_c2660_stepper.html#abe01a905588d5feb41ec3a967512027f">toff</a>() &gt; 0; }</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a72a9a2ecf2d0707dba76de414cec209e">   85</a></span>&#160;uint8_t <a class="code" href="class_t_m_c2660_stepper.html#a72a9a2ecf2d0707dba76de414cec209e">TMC2660Stepper::test_connection</a>() {</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  uint32_t drv_status = <a class="code" href="class_t_m_c2660_stepper.html#a124bab76346c3c6c17f812e8c4ad7a5c">DRVSTATUS</a>();</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="keywordflow">switch</span> (drv_status) {</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;      <span class="keywordflow">case</span> 0xFFCFF: <span class="keywordflow">return</span> 1;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;      <span class="keywordflow">case</span> 0: <span class="keywordflow">return</span> 2;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;      <span class="keywordflow">default</span>: <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;}</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">  Requested current = mA = I_rms/1000</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">  Equation for current:</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">  I_rms = (CS+1)/32 * V_fs/R_sense * 1/sqrt(2)</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment">  Solve for CS -&gt;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">  CS = 32*sqrt(2)*I_rms*R_sense/V_fs - 1</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment">  Example:</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">  vsense = 0b0 -&gt; V_fs = 0.310V //Typical</span></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="comment">  mA = 1650mA = I_rms/1000 = 1.65A</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">  R_sense = 0.100 Ohm</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">  -&gt;</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="comment">  CS = 32*sqrt(2)*1.65*0.100/0.310 - 1 = 24,09</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">  CS = 24</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a625480799004d350a27a24bbb066e4e9">  110</a></span>&#160;uint16_t <a class="code" href="class_t_m_c2660_stepper.html#a625480799004d350a27a24bbb066e4e9">TMC2660Stepper::cs2rms</a>(uint8_t CS) {</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <span class="keywordflow">return</span> (<span class="keywordtype">float</span>)(CS+1)/32.0 * (<a class="code" href="class_t_m_c2660_stepper.html#ae9e78a1a2e7847988c779e81e3ae5545">vsense</a>() ? 0.165 : 0.310)/(Rsense+0.02) / 1.41421 * 1000;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a5a4a17c80ceb1bc88be8588b1c34fb77">  114</a></span>&#160;uint16_t <a class="code" href="class_t_m_c2660_stepper.html#a5a4a17c80ceb1bc88be8588b1c34fb77">TMC2660Stepper::rms_current</a>() {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="class_t_m_c2660_stepper.html#a625480799004d350a27a24bbb066e4e9">cs2rms</a>(<a class="code" href="class_t_m_c2660_stepper.html#a771f1425704e15ed90471bc7db2deaa4">cs</a>());</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;}</div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a95bdde91a19aeb7bb5ee09e6df8ca065">  117</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a5a4a17c80ceb1bc88be8588b1c34fb77">TMC2660Stepper::rms_current</a>(uint16_t mA) {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  uint8_t CS = 32.0*1.41421*mA/1000.0*Rsense/0.310 - 1;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  <span class="comment">// If Current Scale is too low, turn on high sensitivity R_sense and calculate again</span></div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <span class="keywordflow">if</span> (CS &lt; 16) {</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#ae9e78a1a2e7847988c779e81e3ae5545">vsense</a>(<span class="keyword">true</span>);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    CS = 32.0*1.41421*mA/1000.0*Rsense/0.165 - 1;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  } <span class="keywordflow">else</span> { <span class="comment">// If CS &gt;= 16, turn off high_sense_r</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <a class="code" href="class_t_m_c2660_stepper.html#ae9e78a1a2e7847988c779e81e3ae5545">vsense</a>(<span class="keyword">false</span>);</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  }</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <span class="keywordflow">if</span> (CS &gt; 31)</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    CS = 31;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a771f1425704e15ed90471bc7db2deaa4">cs</a>(CS);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;  <span class="comment">//val_mA = mA;</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;}</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a7b71f3e77039b9ec330b6123574f4fdc">  134</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a7b71f3e77039b9ec330b6123574f4fdc">TMC2660Stepper::push</a>() {</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a45ae40bd2b9b997b9cfedb13403e2387">DRVCTRL</a>( <a class="code" href="class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275">sdoff</a>() ? DRVCTRL_1_register.sr : DRVCTRL_0_register.sr);</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#ad584d93cbf798731dcecee465b8b1de6">CHOPCONF</a>(CHOPCONF_register.sr);</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a896275632be88c8a407946df264f94cf">SMARTEN</a>(SMARTEN_register.sr);</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#ab4d49251f5e0d438a07ae46d293aa58c">SGCSCONF</a>(SGCSCONF_register.sr);</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <a class="code" href="class_t_m_c2660_stepper.html#a832e8094055d7b70e95ee49a0ef8e742">DRVCONF</a>(DRVCONF_register.sr);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;}</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a28c5d45baa352c4d19e18edf3eeab294">  142</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#ae3100db503af9aec31cf84198429608c">TMC2660Stepper::hysteresis_end</a>(int8_t value) { <a class="code" href="class_t_m_c2660_stepper.html#a3d4ad562c8344e426a3e5719809e17d3">hend</a>(value+3); }</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#ae3100db503af9aec31cf84198429608c">  143</a></span>&#160;int8_t <a class="code" href="class_t_m_c2660_stepper.html#ae3100db503af9aec31cf84198429608c">TMC2660Stepper::hysteresis_end</a>() { <span class="keywordflow">return</span> <a class="code" href="class_t_m_c2660_stepper.html#a3d4ad562c8344e426a3e5719809e17d3">hend</a>()-3; };</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a6e08c12edd0a4524d0b63eb662a36d5d">  145</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a1efc58c38765c794f36d9a4f09b99524">TMC2660Stepper::hysteresis_start</a>(uint8_t value) { <a class="code" href="class_t_m_c2660_stepper.html#a1c64cfe3c13f4c8c8fe2eebe996fa0eb">hstrt</a>(value-1); }</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a1efc58c38765c794f36d9a4f09b99524">  146</a></span>&#160;uint8_t <a class="code" href="class_t_m_c2660_stepper.html#a1efc58c38765c794f36d9a4f09b99524">TMC2660Stepper::hysteresis_start</a>() { <span class="keywordflow">return</span> <a class="code" href="class_t_m_c2660_stepper.html#a1c64cfe3c13f4c8c8fe2eebe996fa0eb">hstrt</a>()+1; }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a3e059fdcde034717773b2bba0d192390">  148</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#a03129d48b7b62071a217ad8d3d290148">TMC2660Stepper::microsteps</a>(uint16_t ms) {</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  <span class="keywordflow">switch</span>(ms) {</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordflow">case</span> 256: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(0); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <span class="keywordflow">case</span> 128: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(1); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <span class="keywordflow">case</span>  64: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(2); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="keywordflow">case</span>  32: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(3); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordflow">case</span>  16: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(4); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="keywordflow">case</span>   8: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(5); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="keywordflow">case</span>   4: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(6); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">case</span>   2: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(7); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">case</span>   0: <a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>(8); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keywordflow">default</span>: <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  }</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;}</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a03129d48b7b62071a217ad8d3d290148">  163</a></span>&#160;uint16_t <a class="code" href="class_t_m_c2660_stepper.html#a03129d48b7b62071a217ad8d3d290148">TMC2660Stepper::microsteps</a>() {</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  <span class="keywordflow">switch</span>(<a class="code" href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">mres</a>()) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordflow">case</span> 0: <span class="keywordflow">return</span> 256;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> 128;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span>  64;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span>  32;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keywordflow">case</span> 4: <span class="keywordflow">return</span>  16;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">case</span> 5: <span class="keywordflow">return</span>   8;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <span class="keywordflow">case</span> 6: <span class="keywordflow">return</span>   4;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">case</span> 7: <span class="keywordflow">return</span>   2;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordflow">case</span> 8: <span class="keywordflow">return</span>   0;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;  }</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;}</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#a6348de75bdacd6838ca563641af10582">  178</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_t_m_c2660_stepper.html#acb42dacdd4a3244be7ab7ad034832807">TMC2660Stepper::blank_time</a>(uint8_t value) {</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="keywordflow">switch</span> (value) {</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="keywordflow">case</span> 16: <a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>(0b00); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordflow">case</span> 24: <a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>(0b01); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="keywordflow">case</span> 36: <a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>(0b10); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keywordflow">case</span> 54: <a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>(0b11); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  }</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;}</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="class_t_m_c2660_stepper.html#acb42dacdd4a3244be7ab7ad034832807">  187</a></span>&#160;uint8_t <a class="code" href="class_t_m_c2660_stepper.html#acb42dacdd4a3244be7ab7ad034832807">TMC2660Stepper::blank_time</a>() {</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  <span class="keywordflow">switch</span> (<a class="code" href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">tbl</a>()) {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    <span class="keywordflow">case</span> 0b00: <span class="keywordflow">return</span> 16;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keywordflow">case</span> 0b01: <span class="keywordflow">return</span> 24;</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keywordflow">case</span> 0b10: <span class="keywordflow">return</span> 36;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordflow">case</span> 0b11: <span class="keywordflow">return</span> 54;</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  }</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a63505ee4078e1f060a2ccecc30f228bd"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a63505ee4078e1f060a2ccecc30f228bd">TMC2660Stepper::switchCSpin</a></div><div class="ttdeci">void switchCSpin(bool state)</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00025">TMC2660Stepper.cpp:25</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a1efc58c38765c794f36d9a4f09b99524"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a1efc58c38765c794f36d9a4f09b99524">TMC2660Stepper::hysteresis_start</a></div><div class="ttdeci">uint8_t hysteresis_start()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00146">TMC2660Stepper.cpp:146</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a36fec657eca5845bef6668fd2fce1b54"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a36fec657eca5845bef6668fd2fce1b54">TMC2660Stepper::begin</a></div><div class="ttdeci">void begin()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00072">TMC2660Stepper.cpp:72</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a03129d48b7b62071a217ad8d3d290148"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a03129d48b7b62071a217ad8d3d290148">TMC2660Stepper::microsteps</a></div><div class="ttdeci">uint16_t microsteps()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00163">TMC2660Stepper.cpp:163</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a3d4ad562c8344e426a3e5719809e17d3"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a3d4ad562c8344e426a3e5719809e17d3">TMC2660Stepper::hend</a></div><div class="ttdeci">uint8_t hend()</div><div class="ttdef"><b>Definition:</b> <a href="_c_h_o_p_c_o_n_f_8cpp_source.html#l00104">CHOPCONF.cpp:104</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a45ae40bd2b9b997b9cfedb13403e2387"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a45ae40bd2b9b997b9cfedb13403e2387">TMC2660Stepper::DRVCTRL</a></div><div class="ttdeci">uint32_t DRVCTRL()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_c_t_r_l_8cpp_source.html#l00009">DRVCTRL.cpp:9</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_abe01a905588d5feb41ec3a967512027f"><div class="ttname"><a href="class_t_m_c2660_stepper.html#abe01a905588d5feb41ec3a967512027f">TMC2660Stepper::toff</a></div><div class="ttdeci">uint8_t toff()</div><div class="ttdef"><b>Definition:</b> <a href="_c_h_o_p_c_o_n_f_8cpp_source.html#l00102">CHOPCONF.cpp:102</a></div></div>
<div class="ttc" id="aclass_s_w___s_p_i_class_html"><div class="ttname"><a href="class_s_w___s_p_i_class.html">SW_SPIClass</a></div><div class="ttdef"><b>Definition:</b> <a href="_s_w___s_p_i_8h_source.html#l00006">SW_SPI.h:6</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_aec662c467455f109ba504f69495ac90f"><div class="ttname"><a href="class_t_m_c2660_stepper.html#aec662c467455f109ba504f69495ac90f">TMC2660Stepper::isEnabled</a></div><div class="ttdeci">bool isEnabled()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00083">TMC2660Stepper.cpp:83</a></div></div>
<div class="ttc" id="a_t_m_c_stepper_8h_html"><div class="ttname"><a href="_t_m_c_stepper_8h.html">TMCStepper.h</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a5a4a17c80ceb1bc88be8588b1c34fb77"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a5a4a17c80ceb1bc88be8588b1c34fb77">TMC2660Stepper::rms_current</a></div><div class="ttdeci">uint16_t rms_current()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00114">TMC2660Stepper.cpp:114</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a72c064ac219a1fadd2d0410f8e4dd764"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a72c064ac219a1fadd2d0410f8e4dd764">TMC2660Stepper::tbl</a></div><div class="ttdeci">uint8_t tbl()</div><div class="ttdef"><b>Definition:</b> <a href="_c_h_o_p_c_o_n_f_8cpp_source.html#l00108">CHOPCONF.cpp:108</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_ab4d49251f5e0d438a07ae46d293aa58c"><div class="ttname"><a href="class_t_m_c2660_stepper.html#ab4d49251f5e0d438a07ae46d293aa58c">TMC2660Stepper::SGCSCONF</a></div><div class="ttdeci">uint32_t SGCSCONF()</div><div class="ttdef"><b>Definition:</b> <a href="_s_g_c_s_c_o_n_f_8cpp_source.html#l00007">SGCSCONF.cpp:7</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a832e8094055d7b70e95ee49a0ef8e742"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a832e8094055d7b70e95ee49a0ef8e742">TMC2660Stepper::DRVCONF</a></div><div class="ttdeci">uint32_t DRVCONF()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_c_o_n_f_8cpp_source.html#l00007">DRVCONF.cpp:7</a></div></div>
<div class="ttc" id="aclass_s_w___s_p_i_class_html_af260fdc0af3f1312b106483161e559c3"><div class="ttname"><a href="class_s_w___s_p_i_class.html#af260fdc0af3f1312b106483161e559c3">SW_SPIClass::transfer</a></div><div class="ttdeci">uint8_t transfer(uint8_t ulVal)</div><div class="ttdef"><b>Definition:</b> <a href="_s_w___s_p_i_8cpp_source.html#l00024">SW_SPI.cpp:24</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a771f1425704e15ed90471bc7db2deaa4"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a771f1425704e15ed90471bc7db2deaa4">TMC2660Stepper::cs</a></div><div class="ttdeci">uint8_t cs()</div><div class="ttdef"><b>Definition:</b> <a href="_s_g_c_s_c_o_n_f_8cpp_source.html#l00019">SGCSCONF.cpp:19</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a72a9a2ecf2d0707dba76de414cec209e"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a72a9a2ecf2d0707dba76de414cec209e">TMC2660Stepper::test_connection</a></div><div class="ttdeci">uint8_t test_connection()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00085">TMC2660Stepper.cpp:85</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_ae9e78a1a2e7847988c779e81e3ae5545"><div class="ttname"><a href="class_t_m_c2660_stepper.html#ae9e78a1a2e7847988c779e81e3ae5545">TMC2660Stepper::vsense</a></div><div class="ttdeci">bool vsense()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_c_o_n_f_8cpp_source.html#l00028">DRVCONF.cpp:28</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a7b71f3e77039b9ec330b6123574f4fdc"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a7b71f3e77039b9ec330b6123574f4fdc">TMC2660Stepper::push</a></div><div class="ttdeci">void push()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00134">TMC2660Stepper.cpp:134</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a90c921e4f637bb688c5fadf491ee6f44"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a90c921e4f637bb688c5fadf491ee6f44">TMC2660Stepper::mres</a></div><div class="ttdeci">uint8_t mres()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_c_t_r_l_8cpp_source.html#l00041">DRVCTRL.cpp:41</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_aba43e2af829abee9e029bdd43bde5f61"><div class="ttname"><a href="class_t_m_c2660_stepper.html#aba43e2af829abee9e029bdd43bde5f61">TMC2660Stepper::read</a></div><div class="ttdeci">uint32_t read()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00030">TMC2660Stepper.cpp:30</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a124bab76346c3c6c17f812e8c4ad7a5c"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a124bab76346c3c6c17f812e8c4ad7a5c">TMC2660Stepper::DRVSTATUS</a></div><div class="ttdeci">uint32_t DRVSTATUS()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_s_t_a_t_u_s_8cpp_source.html#l00008">DRVSTATUS.cpp:8</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_aa20df51be5967e40cc23132a1d461275"><div class="ttname"><a href="class_t_m_c2660_stepper.html#aa20df51be5967e40cc23132a1d461275">TMC2660Stepper::sdoff</a></div><div class="ttdeci">bool sdoff()</div><div class="ttdef"><b>Definition:</b> <a href="_d_r_v_c_o_n_f_8cpp_source.html#l00027">DRVCONF.cpp:27</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a4ab9b5cf6da0c345ecc50e877b54ada2"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a4ab9b5cf6da0c345ecc50e877b54ada2">TMC2660Stepper::write</a></div><div class="ttdeci">void write(uint8_t addressByte, uint32_t config)</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00054">TMC2660Stepper.cpp:54</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a1c64cfe3c13f4c8c8fe2eebe996fa0eb"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a1c64cfe3c13f4c8c8fe2eebe996fa0eb">TMC2660Stepper::hstrt</a></div><div class="ttdeci">uint8_t hstrt()</div><div class="ttdef"><b>Definition:</b> <a href="_c_h_o_p_c_o_n_f_8cpp_source.html#l00103">CHOPCONF.cpp:103</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_ad584d93cbf798731dcecee465b8b1de6"><div class="ttname"><a href="class_t_m_c2660_stepper.html#ad584d93cbf798731dcecee465b8b1de6">TMC2660Stepper::CHOPCONF</a></div><div class="ttdeci">uint32_t CHOPCONF()</div><div class="ttdef"><b>Definition:</b> <a href="_c_h_o_p_c_o_n_f_8cpp_source.html#l00085">CHOPCONF.cpp:85</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a896275632be88c8a407946df264f94cf"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a896275632be88c8a407946df264f94cf">TMC2660Stepper::SMARTEN</a></div><div class="ttdeci">uint32_t SMARTEN()</div><div class="ttdef"><b>Definition:</b> <a href="_s_m_a_r_t_e_n_8cpp_source.html#l00007">SMARTEN.cpp:7</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_ad4519bfdf8acc6afdceed090708ea826"><div class="ttname"><a href="class_t_m_c2660_stepper.html#ad4519bfdf8acc6afdceed090708ea826">TMC2660Stepper::TMC2660Stepper</a></div><div class="ttdeci">TMC2660Stepper(uint16_t pinCS, float RS=default_RS)</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00004">TMC2660Stepper.cpp:4</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_acb42dacdd4a3244be7ab7ad034832807"><div class="ttname"><a href="class_t_m_c2660_stepper.html#acb42dacdd4a3244be7ab7ad034832807">TMC2660Stepper::blank_time</a></div><div class="ttdeci">uint8_t blank_time()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00187">TMC2660Stepper.cpp:187</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_a625480799004d350a27a24bbb066e4e9"><div class="ttname"><a href="class_t_m_c2660_stepper.html#a625480799004d350a27a24bbb066e4e9">TMC2660Stepper::cs2rms</a></div><div class="ttdeci">uint16_t cs2rms(uint8_t CS)</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00110">TMC2660Stepper.cpp:110</a></div></div>
<div class="ttc" id="a_s_w___s_p_i_8h_html"><div class="ttname"><a href="_s_w___s_p_i_8h.html">SW_SPI.h</a></div></div>
<div class="ttc" id="aclass_t_m_c2660_stepper_html_ae3100db503af9aec31cf84198429608c"><div class="ttname"><a href="class_t_m_c2660_stepper.html#ae3100db503af9aec31cf84198429608c">TMC2660Stepper::hysteresis_end</a></div><div class="ttdeci">int8_t hysteresis_end()</div><div class="ttdef"><b>Definition:</b> <a href="_t_m_c2660_stepper_8cpp_source.html#l00143">TMC2660Stepper.cpp:143</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_94e7a0fbe7f8eaf7f05ee7b02c647e9f.html">source</a></li><li class="navelem"><a class="el" href="_t_m_c2660_stepper_8cpp.html">TMC2660Stepper.cpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
